package com.explorati.interview.interview.Thread;

public class Test {

	public static void main(String[] args) {
		Test obj = new Test();
		obj.init();
	}

	private void init() {
		final Test3Business tb = new Test3Business();

		Thread t1 = new Thread(new Runnable() {
			@Override
			public void run() {
				for (int i = 0; i < 10; i++) {
					tb.printA();
				}
			}
		});
		t1.setName("A");
		
		Thread t2 = new Thread(new Runnable() {
			@Override
			public void run() {
				for (int i = 0; i < 10; i++) {
					tb.printB();
				}
			}
		});
		t2.setName("B");
		
		Thread t3 = new Thread(new Runnable() {
			@Override
			public void run() {
				for (int i = 0; i < 10; i++) {
					tb.printC();
				}
			}
		});
		t3.setName("C");
		t1.start();
		t2.start();
		t3.start();
	}
}
